2
天氣顧問(智能代理)
PolyU COMP5511Lab 11 | 2026-03-30
00:00

核心概念 — 大腦與手腳

在之前的實驗中,我們看到了大型語言模型(LLMs)的強大之處,但也發現了一個重大弱點:它們被關在一個封閉的空間裡。它們只了解訓練時所學的內容,無法與現實世界互動。

AI 智能代理 透過結合兩個截然不同的組件來解決這個問題:

  • 大腦: 大型語言模型(如 Qwen3-4B),能夠理解人類語言、處理邏輯並維持對話上下文。
  • 手腳: 可主動與現實世界互動的 Python 程式碼與外部工具(API),例如查詢天氣、瀏覽網路或執行運算。
教大腦如何使用手腳
大型語言模型無法自然地「按按鈕」或「執行」Python 程式。今天我們的目標是教導大腦如何辨識何時需要協助,並將輸出格式化,讓我們的 Python 程式能為它執行工具。 它。
A clean, modern conceptual illustration showing a glowing digital brain representing an LLM connected via glowing data lines to a pair of robotic or digital hands manipulating code blocks and gears, representing real-world tools. Minimalist tech aesthetic with light blue and soft orange accent colors.